// 分类相关的API接口函数
import request from '@/utils/request'

// 首页-全部分类
export const findAllCategory = () => {
  return request({
    url: '/home/category/head',
    method: 'get'
  })
}

// 获取单个顶级分类信息
export const findTopCategory = (id) => {
  return request({
    url: '/category',
    method: 'get',
    params: {
      id
    }
  })
}

// 获取二级分类筛选条件数据
export const findSubCategoryFilter = (id) => {
  return request({
    url: '/category/sub/filter',
    method: 'get',
    params: { id }
  })
}

// 获取筛选数据
export const findSubcategoryList = (data) => {
  return request({
    url: '/category/goods/temporary',
    method: 'post',
    data
  })
}